package com.ynet.middleground.approve.dto;

import java.io.Serializable;
import java.util.Date;
import java.util.List;
import java.util.Map;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * @author liulx
 * @description 流程走向记录任务信息传输对象
 * @date 2019-12-11 17:23
 */
@Data
@ApiModel(value = "历史任务信息传输对象", description = "流程走向记录，任务信息传输对象")
public class HistoryTaskDTO implements Serializable {

    private static final long serialVersionUID = -5407908231038883500L;

    @ApiModelProperty(value = "任务ID", notes = "任务ID", dataType = "String")
    private String id;

    @ApiModelProperty(value = "任务处理人", notes = "任务处理人", dataType = "String")
    private String assignee;

    @ApiModelProperty(value = "任务名称", notes = "任务节点名称", dataType = "String")
    private String name;

    @ApiModelProperty(value = "任务描述", notes = "任务节点描述", dataType = "String")
    private String description;

    @ApiModelProperty(value = "开始时间（毫秒）", notes = "开始时间（毫秒）", dataType = "java.util.Date")
    private Date startTime;

    @ApiModelProperty(value = "结束时间（毫秒）", notes = "结束时间（毫秒）", dataType = "java.util.Date")
    private Date endTime;

    @ApiModelProperty(value = "持续时间（毫秒） \n持续时间=结束时间-开始时间", notes = "持续时间（毫秒） \n持续时间=结束时间-开始时间")
    private Long durationInMillis;

    @ApiModelProperty(value = "处理时间（毫秒） \n处理时间=结束时间-任务领取时间", notes = "处理时间（毫秒） \n处理时间=结束时间-任务领取时间")
    private Long workTimeInMillis;

    @ApiModelProperty(value = "类别", notes = "任务类别", dataType = "String")
    private String category;

    @ApiModelProperty(value = "流程实例ID", notes = "流程实例ID，任务所归属的流程实例", dataType = "String")
    private String processInstanceId;

    @ApiModelProperty(value = "流程定义ID", notes = "流程定义ID", dataType = "String")
    private String processDefinitionId;

    @ApiModelProperty(value = "任务定义Key", notes = "任务定义Key，对应activiti-modeler任务信息的ID值", dataType = "String")
    private String taskDefinitionKey;

    @ApiModelProperty(value = "任务领取时间（毫秒）", notes = "任务领取时间（毫秒），组任务需要领取", dataType = "java.util.Date")
    private Date claimTime;

    @ApiModelProperty(value = "删除理由", notes = "特殊操作理由，调用驳回服务、退回服务时会使用", dataType = "java.util.Date")
    private String deleteReason;

    @ApiModelProperty(value = "任务读取状态，0: 待审批 1：已读", notes = "任务读取状态，0: 待审批 1：已读", dataType = "Integer")
    private Integer readState;

    @ApiModelProperty(value = "业务动作提示\n该字段值也存在于任务参数中", notes = "业务动作提示\n该字段值也存在于任务参数中", dataType = "java.util.Map")
    private Map<String, Object> businessOperateVariables;

    @ApiModelProperty(value = "任务参数", notes = "任务参数", dataType = "java.util.Map")
    private Map<String, Object> taskLocalVariables;

    @ApiModelProperty(
        value = "操作结果，\n 0: 发起申请,\n 1: 同意,\n 2: 驳回（退到上一任务）,\n"
            + " 3: 退回（退到发起人）,\n 4: 拒绝（用于会签投票）,\n 5: 撤销申请,\n 6: 跳转,\n 7:驳回至发起人, \n 8:转办;",
        notes = "审批结果，是否通过审核，该字段仅用于记录任务操作人的意图\n 0: 发起申请,\n 1: 同意,\n 2: 驳回（退到上一任务）,\n"
            + " 3: 退回（退到发起人）,\n 4: 拒绝（用于会签投票）,\n 5: 撤销申请,\n 6: 跳转,\n 7:驳回至发起人, \n 8:转办;",
        required = true, dataType = "String")
    private String approveResult;

    @ApiModelProperty(value = "是否会签", notes = "是否会签", dataType = "boolean")
    private boolean countersign;

    @ApiModelProperty(value = "会签号；该任务节点是会签时，该字段有值", notes = "会签号；该任务节点是会签时，该字段有", dataType = "String")
    private String counterSignNumber;

    @ApiModelProperty(value = "发起人Id", notes = "发起人Id", dataType = "String")
    private String startUserId;

    @ApiModelProperty(value = "发起渠道标志", notes = "发起渠道标志", dataType = "String")
    private String startChannelSignal;

    @ApiModelProperty(value = "流程发起时间(时间戳)", notes = "流程发起时间(时间戳)", dataType = "String")
    private String processStartTime;

    @ApiModelProperty(value = "流程参数", notes = "流程参数", dataType = "java.util.Map")
    private Map<String, Object> processVariables;

    @ApiModelProperty(value = "当前任务评论（意见）列表", notes = "当前任务评论记录")
    private List<CommentDTO> taskComments;

}
